#定义对象库存的基类
from selenium.webdriver.support.wait import WebDriverWait

from until import UtilsDriver

# 对象库层基类的封装
class BasePage:
    def __init__(self):
        self.driver = UtilsDriver.get_mp_driver() #获取自媒体浏览器驱动

    # 获取元素对象
    def get_element(self, location):
        # 显式等待
        wait = WebDriverWait(self.driver, 10,1)
        element = wait.until(lambda x: x.find_element(*location))
        return element


# 操作层基类的封装
class BaseHandle:
    def input_text(self, element, text):
        element.clear()
        element.send_keys(text)
